package com.dragon.backstage.domain.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 用户操作日志导出excel
 *
 * @author dragon
 * @version 1.0
 * @date 2024/10/11 18:24
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = "用户操作日志导出excel")
public class UserOperateLogExportExcel {

    @Schema(title = "用户操作日志ID")
    @ColumnWidth(25)
    @ExcelProperty(value = "用户操作日志ID")
    private Long operateId;

    @Schema(title = "追踪ID")
    @ColumnWidth(25)
    @ExcelProperty(value = "追踪ID")
    private String traceId;

    @Schema(title = "操作人员")
    @ColumnWidth(25)
    @ExcelProperty(value = "操作人员")
    private String operateAccount;

    @Schema(title = "模块标题")
    @ColumnWidth(25)
    @ExcelProperty(value = "模块标题")
    private String title;

    @Schema(title = "业务类型（0其它 1新增 2修改 3删除）")
    @ColumnWidth(25)
    @ExcelProperty(value = "业务类型")
    private String businessTypeDes;

    @Schema(title = "方法名称")
    @ColumnWidth(25)
    @ExcelProperty(value = "方法名称")
    private String method;

    @Schema(title = "请求方式")
    @ColumnWidth(25)
    @ExcelProperty(value = "请求方式")
    private String requestMethod;

    @Schema(title = "请求URL")
    @ColumnWidth(25)
    @ExcelProperty(value = "请求URL")
    private String requestUrl;

    @Schema(title = "主机地址")
    @ColumnWidth(25)
    @ExcelProperty(value = "主机地址")
    private String requestIp;

    @Schema(title = "操作地点")
    @ColumnWidth(25)
    @ExcelProperty(value = "操作地点")
    private String operateLocation;

    @Schema(title = "请求参数")
    @ColumnWidth(25)
    @ExcelProperty(value = "请求参数")
    private String requestParam;

    @Schema(title = "返回参数")
    @ColumnWidth(25)
    @ExcelProperty(value = "返回参数")
    private String jsonResult;

    @Schema(title = "操作状态（1正常 0异常）")
    @ColumnWidth(25)
    @ExcelProperty(value = "操作状态")
    private String statusDes;

    @Schema(title = "错误消息")
    @ColumnWidth(25)
    @ExcelProperty(value = "错误消息")
    private String errorMsg;

    @Schema(title = "操作时间")
    @ColumnWidth(25)
    @ExcelProperty(value = "操作时间")
    private LocalDateTime operateTime;

    @Schema(title = "消耗时间（毫秒）")
    @ColumnWidth(25)
    @ExcelProperty(value = "消耗时间(毫秒)")
    private Long costTime;

}
